package com.lineage.server.timecontroller.pet;

import com.lineage.server.model.Instance.L1NpcInstance;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class HMprPet {
  private static final Log _log = LogFactory.getLog(HMprPet.class);
  
  public static boolean mpUpdate(L1NpcInstance npc, int time) {
    try {
      if (npc.getMaxHp() <= 0)
        return false; 
      if (npc.getMaxMp() <= 0)
        return false; 
      if (npc.isDead())
        return false; 
      if (npc.destroyed())
        return false; 
      if (npc.getCurrentHp() <= 0)
        return false; 
      if (npc.getCurrentMp() >= npc.getMaxMp())
        return false; 
      npc.setCurrentMp(npc.getCurrentMp() + 10);
    } catch (Exception e) {
      _log.error(e.getLocalizedMessage(), e);
    } 
    return false;
  }
}
